package com.github.aloxc.plugin.restplus.listener;

import com.github.aloxc.plugin.restplus.navigator.RestServicesNavigator;
import com.intellij.openapi.project.Project;

import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
/**
 *
 * @author leero
 */
public class RefreshListener extends MouseAdapter {
    private Project project;
    public RefreshListener(Project project){
        this.project = project;
    }
    @Override
    public void mouseClicked(MouseEvent e) {
      /*if(project == null) return ;
      RestServiceProjectsManager manager = RestServiceProjectsManager.getInstance(project);
      perform(manager);*/
        this.doRefreshProject();
    }
    public void doRefreshProject() {
        RestServicesNavigator servicesNavigator = project.getComponent(RestServicesNavigator.class);
//        servicesNavigator.initComponent();
        servicesNavigator.scheduleStructureUpdate();
    }
}
